package com.wodsy.phoenix.dataobject.shoppingcart.model;

// Generated 2015-5-15 14:59:21 by Hibernate Tools 3.4.0.CR1

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.wodsy.phoenix.dataobject.base.PhoenixObject;

/**
 * TbShoppingcartItem generated by hbm2java
 */
@Entity
@Table(name = "tb_shoppingcart_item", catalog = "shoppingcartc")
public class ShoppingcartItem extends PhoenixObject {

	private Integer id;
	//private long shoppingcartId;
	private int goodsId;
	private int sellerUserId;
	private int shopId;
	private int skuId;
	private int skuCount;
	private Double skuSalePrice;
	private Double skuDealPrice;
	private int itemStatus;
	private int itemType;
	private Integer mstItemId;
	private Date createTime;
	private Date updateTime;

	private Shoppingcart shoppingcart;
	
	private ShoppingcartItemExt shoppingcartItemExt;
	private Set<SkuProperty> skuPropertySet;
	
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="shoppingcartId")
	public Shoppingcart getShoppingcart() {
		return shoppingcart;
	}

	public void setShoppingcart(Shoppingcart shoppingcart) {
		this.shoppingcart = shoppingcart;
	}
	@OneToOne(cascade=CascadeType.ALL,mappedBy="shoppingcartItem")
	public ShoppingcartItemExt getShoppingcartItemExt() {
		return shoppingcartItemExt;
	}

	public void setShoppingcartItemExt(ShoppingcartItemExt shoppingcartItemExt) {
		this.shoppingcartItemExt = shoppingcartItemExt;
	}

	@OneToMany(cascade=CascadeType.ALL,mappedBy="shoppingcartItem", fetch = FetchType.EAGER)
	public Set<SkuProperty> getSkuPropertySet() {
		return skuPropertySet;
	}

	public void setSkuPropertySet(Set<SkuProperty> skuPropertySet) {
		this.skuPropertySet = skuPropertySet;
	}
	
	
	public ShoppingcartItem() {
	}

	public ShoppingcartItem(int goodsId,
			int sellerUserId, int shopId, int skuId, int skuCount,
			int itemStatus, int itemType, Date createTime) {
		this.goodsId = goodsId;
		this.sellerUserId = sellerUserId;
		this.shopId = shopId;
		this.skuId = skuId;
		this.skuCount = skuCount;
		this.itemStatus = itemStatus;
		this.itemType = itemType;
		this.createTime = createTime;
	}

	public ShoppingcartItem( int goodsId,
			int sellerUserId, int shopId, int skuId, int skuCount,
			Double skuSalePrice, Double skuDealPrice, int itemStatus,
			int itemType, Integer mstItemId, Date createTime, Date updateTime) {
		this.goodsId = goodsId;
		this.sellerUserId = sellerUserId;
		this.shopId = shopId;
		this.skuId = skuId;
		this.skuCount = skuCount;
		this.skuSalePrice = skuSalePrice;
		this.skuDealPrice = skuDealPrice;
		this.itemStatus = itemStatus;
		this.itemType = itemType;
		this.mstItemId = mstItemId;
		this.createTime = createTime;
		this.updateTime = updateTime;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "goods_id", nullable = false)
	public int getGoodsId() {
		return this.goodsId;
	}

	public void setGoodsId(int goodsId) {
		this.goodsId = goodsId;
	}

	@Column(name = "seller_user_id", nullable = false)
	public int getSellerUserId() {
		return this.sellerUserId;
	}

	public void setSellerUserId(int sellerUserId) {
		this.sellerUserId = sellerUserId;
	}

	@Column(name = "shop_id", nullable = false)
	public int getShopId() {
		return this.shopId;
	}

	public void setShopId(int shopId) {
		this.shopId = shopId;
	}

	@Column(name = "sku_id", nullable = false)
	public int getSkuId() {
		return this.skuId;
	}

	public void setSkuId(int skuId) {
		this.skuId = skuId;
	}

	@Column(name = "sku_count", nullable = false)
	public int getSkuCount() {
		return this.skuCount;
	}

	public void setSkuCount(int skuCount) {
		this.skuCount = skuCount;
	}

	@Column(name = "sku_sale_price", precision = 22, scale = 0)
	public Double getSkuSalePrice() {
		return this.skuSalePrice;
	}

	public void setSkuSalePrice(Double skuSalePrice) {
		this.skuSalePrice = skuSalePrice;
	}

	@Column(name = "sku_deal_price", precision = 22, scale = 0)
	public Double getSkuDealPrice() {
		return this.skuDealPrice;
	}

	public void setSkuDealPrice(Double skuDealPrice) {
		this.skuDealPrice = skuDealPrice;
	}

	@Column(name = "item_status", nullable = false)
	public int getItemStatus() {
		return this.itemStatus;
	}

	public void setItemStatus(int itemStatus) {
		this.itemStatus = itemStatus;
	}

	@Column(name = "item_type", nullable = false)
	public int getItemType() {
		return this.itemType;
	}

	public void setItemType(int itemType) {
		this.itemType = itemType;
	}

	@Column(name = "mst_item_id")
	public Integer getMstItemId() {
		return this.mstItemId;
	}

	public void setMstItemId(Integer mstItemId) {
		this.mstItemId = mstItemId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "create_time", nullable = false, length = 19)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "update_time", length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	@Override
	public String toString() {
		return "ShoppingcartItem [id=" + id + ", goodsId=" + goodsId
				+ ", sellerUserId=" + sellerUserId + ", shopId=" + shopId
				+ ", skuId=" + skuId + ", skuCount=" + skuCount
				+ ", skuSalePrice=" + skuSalePrice + ", skuDealPrice="
				+ skuDealPrice + ", itemStatus=" + itemStatus + ", itemType="
				+ itemType + ", mstItemId=" + mstItemId + ", createTime="
				+ createTime + ", updateTime=" + updateTime
				+ ", shoppingcartItemExt=" + shoppingcartItemExt
				+ ", skuPropertySet=" + skuPropertySet + "]";
	}
	
	

}
